package com.cos.web.controller;

import com.cos.util.PhoneCodeUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * @author: COS
 * @time: 2021/11/17 14:10
 * @description:
 */
@Controller
@RequestMapping("/emp")
public class EmpController {
    /**
     *
     * @author: COS
     * @return:
     * @time: 2021/11/17 16:48
     * @description: 获取手机验证码
     */
    @RequestMapping("/getCode")
    @ResponseBody
    public String getCode(String phone, HttpSession session){
        String code = PhoneCodeUtil.getCode(phone);
        System.out.println(code);
        session.setAttribute("c",code);
        return "OK";
    }


    @RequestMapping("/getAll")
    public String getAllEmp() {
        //1 业务
        System.out.println(10/0);
        //2 业务
        return null;
    }

    @RequestMapping("/addEmp")
    public String addEmp() {
        Object o = null;
        System.out.println(o.equals(""));
        return null;
    }

    @RequestMapping("/delEmp")
    public String delEMp() {
        System.out.println(Integer.valueOf("alsiuibfsieuehbf"));
        return null;
    }

}
